<?php

namespace app\api\controller\v2;

use app\api\logic\Category;
use app\api\logic\Money;
use app\api\logic\TaskLogic;
use app\common\controller\Api;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = '*';

    /**
     * 首页
     */
    public function index() {
        //所有分类
        $data['cate'] = Category::instance()->getAll(8);  //服务行业
        $Adszone = new \addons\adszone\library\Adszone();
        $data['banner'] = $Adszone->getAdsByMark('first'); //按照标记调用广告位
        //待发众包费 应发众包费
        $data['money'] = Money::instance()->setUserId(UID)->moneySum();
        //获取任务列表
        $data['tasks'] = TaskLogic::instance()->getTask(10);
        $this->success('首页数据', $data);
    }
}
